package com.witframework.meta;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.javalid.annotations.validation.LovConstraint;
import org.javalid.annotations.validation.MaxLength;
import org.javalid.annotations.validation.NotNull;

import com.witframework.core.annotations.Wit;

/**
 * 应用的元数据描述
 * @author wuxinyang
 * Jun 5, 2009 5:39:29 PM
 *
 */

@Entity @Table(name="Meta_App") @Wit(cnname="应用",cnproperty="name")
public class MetaApp extends BaseMetaObject{
	
	@NotNull(globalMessage=true) @MaxLength(length=100)	 @Wit(cnname="名称")
	@Column(length=100) 
    private String name;	
	
	@LovConstraint (values={"SYSTEM","USER"})
	@Column(length=10) @Wit(cnname="数据类型",description="user,system; system类型的不允许删除")    
	private String dateType="USER";
    
    @OneToMany(mappedBy="metaApp") @LazyCollection(value=LazyCollectionOption.FALSE)
    @Wit(cnname="属性列表",description="属性列表	")
	private List<MetaModule> modules;//属性列表	

	
    
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
	public String getDateType() {		
		return dateType;
	}

	public void setDateType(String dateType) {
		this.dateType = dateType;
	}

	public List<MetaModule> getModules() {
		return modules;
	}

	public void setModules(List<MetaModule> modules) {
		this.modules = modules;
	}
	
}